<?php include template("header");?>

<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="coupons">
	<div class="dashboard" id="dashboard">
		<ul><?php echo current_account('gio-hang'); ?></ul>
	</div>
    <div id="content" class="coupons-box clear">
		<div class="box clear">
            <div class="box-top"></div>
            <div class="box-content">
                <div class="head">
                    <h2>Giỏ hàng</h2>
                    <ul class="filter">
						<li class="label"><?php echo current_order_index($selector); ?></li>						
					</ul>
				</div>
                <div class="sect">
					<table id="orders-list" cellspacing="0" cellpadding="0" border="0" class="coupons-table">
						<tr class="forum_title_tr"><th>Mã ĐH #</th><th width="380">Sản phẩm</th><th width="60">Số lượng</th><th width="60">Thành tiền</th><th width="60">Tình trạng</th><th width="60">Thao tác</th><th width="60">Hủy</th></tr>
					<?php if(is_array($orders)){foreach($orders AS $index=>$one) { ?>
						<tr <?php echo $index%2?'':'class="alt"'; ?>>
							<td><?php echo $one['code']; ?></td>
							<td style="text-align:left;"><a class="deal-title" href="/team.php?id=<?php echo $one['team_id']; ?>" target="_blank"><?php echo sub_str($teams[$one['team_id']]['title'],50); ?></a></td>
							<td><?php echo $one['quantity']; ?></td>
							<td><?php echo formatMoney($one['origin'],0); ?></td>
							<td width="179px"><?php if($one['state']=='pay'){?><b style="color: green">Đã thanh toán</b><?php } else if($teams[$one['team_id']]['close_time']>0) { ?><b style="color: #666;">Hết hạn</b><?php } else { ?><b style="color: red;">Chưa thanh toán</b><?php }?><!--{/if}--></td>
							<td class="op"><?php if(($one['state']=='unpay'&&$teams[$one['team_id']]['close_time']==0)){?><a href="/order/check.php?id=<?php echo $one['id']; ?>">thanh toán</a><?php } else if($one['state']=='pay') { ?><a href="/order/success.php?order_id=<?php echo $one['id']; ?>">chi tiết</a><?php }?></td>					
							<td class="op">
							<?php if(($one['state']=='unpay'&&$teams[$one['team_id']]['close_time']==0)){?>
							<a href="/order/remove.php?orderID=<?php echo $one['id']; ?>" class="ajaxlink" ask="Bạn muốn hủy đơn hàng này?">Hủy</a>
							<?php } else { ?>
							<b style='text-decoration: line-through;'>Hủy</b>
							<?php }?>
							</td>
						</tr>
					<?php }}?>
						<tr><td colspan="6"><?php echo $pagestring; ?></td></tr>
                    </table>
				</div>
            </div>
            <div class="box-bottom"></div>
        </div>
    </div>
    <div id="sidebar">
		<!--{//include block_side_aboutorder}-->
    </div>
</div>
</div> <!-- bd end -->
</div> <!-- bdw end -->
<?php include template("footer");?>